<?=$this->header(true, false, true)?>


    <?=$this->menu("forums")?>


    <h1><?=$this->message("label.header", _Forum::BUNDLE)?></h1>


    <? /* Breadcrums route */ ?>
    <?=$this->route(
        array(
            array(
                "name"=>$this->message("label.category.header", _Forum::BUNDLE),
                "href"=>"forum/category/list"
            ),
            array(
                "name"=>$this->category($this->replyForm->getReply()->getTopic()->getCategoryId()),
                "href"=>"forum/list?id=".$this->replyForm->getReply()->getTopic()->getCategoryId()
            ),
            array(
                "name"=>$this->message("label.replies.for", _Forum::BUNDLE) . " \"" . $this->replyForm->getReply()->getTopic()->getName() ."\"",
                "href"=>"forum/reply/list?id=".$this->replyForm->getReply()->getTopicId()
            ),
            $this->replyForm->getReply()->getTopicReplyId() > 0 ?
                $this->message("route.edit", _Core::BUNDLE) . " " .
                    "\"".$this->replyForm->getReply()->getUsername()."\", \"".$this->replyForm->getReply()->getInsertDate(_Core::FORMAT_DATETIME)."\" " :
                $this->message("route.new", _Core::BUNDLE) . " " . $this->message("label.reply.item", _Forum::BUNDLE)
            )
        )
    ?>


    <? /* Show error messages */ ?>
    <?=$this->errors(null, _Forum::BUNDLE)?>


    <form id="<?=get_class($this->replyForm)?>" action="forum/reply/save" method="post">

        <div>
            <input type="hidden"
                   name="reply->topicReplyId"
                   value="<?=$this->replyForm->getReply()->getTopicReplyId()?>" />
            <input type="hidden"
                   name="reply->topicId"
                   value="<?=$this->replyForm->getReply()->getTopicId()?>" />
        </div>

        <fieldset>

            <legend><?=$this->message("label.required")?></legend>

            <table cellspacing="0" cellpadding="0" class="form">
            <tr class="ctrl<?=$this->error("reply->body")?>">
                <th><label for="reply_body"><?=$this->message("prompt.body", _Forum::BUNDLE)?></label></th>
                <th class="required"><em>*</em></th>
                <td>
                    <textarea id="reply_body" name="reply->body" mce_editable="true" rows="20" cols="80"><?=!is_null($this->replyForm->getReply()->getBody()) ?
                        htmlspecialchars($this->replyForm->getReply()->getBody()->getContents()) : ""?></textarea>
                </td>
            </tr>
            </table>

        </fieldset>

        <div class="buttons">

            <input type="button"
                   onclick="to('topic/reply/list?id=<?=$this->replyForm->getReply()->getTopicId()?>')"
                   value="<?=$this->message("button.cancel", _Core::BUNDLE)?>"
                   class="button" />
            <input type="submit"
                   value="<?=$this->message("button.submit", _Core::BUNDLE)?>"
                   class="button" />

        </div>

    </form>

<?=$this->footer()?>